<template>
  <div>
    <h2>用户登录列表页面</h2>
    <table class="table" border="1">
      <tr>
        <td>用户名</td>
        <td>密码</td>
        <td>注册时间</td>
      </tr>
      <tr v-for="item in list">
        <td>{{item.Uname  }}</td>
        <td>{{ item.Upwd .substring(0,4)+"***"}}</td>
        <td>{{item.Udate.substring(0,10)}}</td>
      </tr>
    </table>
  </div>
</template>

<script setup lang="ts">
 import router from '@/router';
import axios from 'axios';
import {reactive,toRefs,onMounted} from 'vue'
  let data=reactive({
    list:{}
    })
    let {list}=toRefs(data);
    onMounted(()=>{
      Getlist()
    })
    function Getlist()
    {
      
      axios({
        url:"http://localhost:57328/api/User/GetUserList",
        method:"get",
      })
      .then(res=>{
        console.log(res);
        list.value=res.data.data
      })
      .catch(err=>{
        console.log(err);
      })
    }
</script>

<style scoped>

</style>